{php include wl_template('common/header');}
<ul class="nav nav-tabs">
	<li ><a href="{php echo web_url('dashboard/nav/index')}">导航栏</a></li>
	<li class="active"><a href="{php echo web_url('dashboard/nav/edit')}">{if empty($nav['id'])}添加导航{else}编辑导航{/if}</a></li>
</ul>
<div class="app-content">
	<div class="app-form">
		<form action="" method="post" class="form-horizontal form form-validate" >
			<input type="hidden" name="id" value="{$nav['id']}" />
			<div class="panel panel-default">
				<div class="panel-heading">导航栏设置</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">排序</label>
					<div class="col-sm-9">
						<input type="text" name="nav[displayorder]" placeholder="默认排序为0" class="form-control" value="{$nav['displayorder']}" >
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">导航栏标题<span class="must-fill">*</span></label>
					<div class="col-sm-9">
						<input type="text" name="nav[name]" required class="form-control" value="{$nav['name']}" >
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">标题颜色</label>
					<div class="col-sm-9">
						<div class="input-group">
							<input type="color" name="nav[color]" required id="color" value="{$nav['color']}" class="form-control"  >
							<span id="reset"  class="input-group-addon btn btn-default">重置</span>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">导航栏图片<span class="must-fill">*</span></label>
					<div class="col-sm-9">
						{php echo attachment_select('nav[thumb]', $nav['thumb'])}
						<span class="help-block">建议图片大小80*80</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label" >导航栏连接</label>
					<div class="col-sm-9">
						<div class="input-group">
							<input type="text" value="{$nav['link']}" class="form-control valid" name="link" readonly="readonly" id="advlink">
							<span data-input="#advlink" data-toggle="selectUrl" class="input-group-addon btn btn-default">选择链接</span>
						</div>
					</div>
				</div>
				<!--<div class="form-group">-->
					<!--<label class="col-sm-2 control-label">导航栏位置</label>-->
					<!--<div class="col-sm-9">-->
						<!--<select name="nav[type]" class="form-control">-->
							<!--<option value="0" {if $nav['type'] == 0 || empty($nav['type'])} selected="selected" {/if} >首页</option>-->
							<!--&lt;!&ndash;<option value="1" {if $nav['type'] == 1} selected="selected" {/if} >一卡通</option>&ndash;&gt;-->
						<!--</select>-->
					<!--</div>-->
				<!--</div>-->
				<div class="form-group">
					<label class="col-sm-2 control-label">是否显示</label>
					<div class="col-sm-9">
						<div class="radio-inline">
							<input type="radio" name='enabled' value='1' {if $nav['enabled']==1}checked{/if}>是
						</div>
						<div class="radio-inline">
							<input type="radio" name='enabled' value='0' {if $nav['enabled']==0}checked{/if}>否
						</div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"></label>
				<div class="col-sm-9">
					<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" />
					<input type="hidden" name="token" value="{$_W['token']}" />
				</div>
			</div>
		</form>
	</div>
</div>
<script>
	$('input[name="nav[thumb]"]').attr('required','required');
	$("#reset").on('click',function(){
		$("#color").val('#666').trigger('propertychange');
	});
</script>
{php include wl_template('common/footer');}